Ext.define('EUniversitySuperAdmin.controller.principalmenus', {
 
	extend: 'Ext.app.Controller',
    views: [
     		'principalmenus.principalmenus'
        	
    		],
      refs : [{
        ref: 'principalmenus',
        selector: 'principalmenus',
       
    },{
    	ref :'viewport',
    	selector : 'viewport'
    }],
    LoadHtmlForm:function(item, checked){
    	
    	Ext.getCmp("tabs").add(
				{
					title: item.text,/////////////////////////
					autoHeight:true,
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src :item.id
			        }
				    
				}
		).show();
    	
    },
    init: function() {
    	var me=this;
    	
    	this.control({
             
             'principalmenus menuitem' :{
            	 click:this.LoadHtmlForm
             }
         });
    	Ext.Ajax.request({
   		 url: 'admin/administration/getmenuebyprofile',
		    success: function(response){
		    	var view = Ext.widget("principalmenus",{
		    		items: Ext.JSON.decode(response.responseText)
    	    	});
		    	me.getViewport().layout.regions.north.add(view);
		    }
    	});
    	
    	
    	/* 
    	*/
    } ,
    onPanelRendered:function(){
   
    }
    
});